home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / ab20_archive / datacomm / xpr / xprkermit-1.111.lzh / xproto.h < prev   
C/C++ Source or Header  |  1991-03-06  |  5KB  |  125 lines

  1. #if !defined(XPROTO_H)
  2.  
  3. #define XPROTO_H
  4.  
  5. /** xproto.h
  6. *
  7. *   Include file for External Protocol Handling
  8. *
  9. **/
  10. /*
  11. *   The structure
  12. */
  13. struct XPR_IO {
  14.                   char  *xpr_filename;      /* File name(s)             */
  15.                   long (*xpr_fopen)();      /* Open file                */
  16.                   long (*xpr_fclose)();     /* Close file               */
  17.                   long (*xpr_fread)();      /* Get char from file       */
  18.                   long (*xpr_fwrite)();     /* Put string to file       */
  19.                   long (*xpr_sread)();      /* Get char from serial     */
  20.                   long (*xpr_swrite)();     /* Put string to serial     */
  21.                   long (*xpr_sflush)();     /* Flush serial input buffer*/
  22.                   long (*xpr_update)();     /* Print stuff              */
  23.                   long (*xpr_chkabort)();   /* Check for abort          */
  24.                   long (*xpr_chkmisc)();    /* Check misc. stuff        */
  25.                   long (*xpr_gets)();       /* Get string interactively */
  26.                   long (*xpr_setserial)();  /* Set and Get serial info  */
  27.                   long (*xpr_ffirst)();     /* Find first file name     */
  28.                   long (*xpr_fnext)();      /* Find next file name      */
  29.                   long (*xpr_finfo)();      /* Return file info         */
  30.                   long (*xpr_fseek)();      /* Seek in a file           */
  31.                   long   xpr_extension;     /* Number of extensions     */
  32.                   void  *xpr_data;          /* Initialized by Setup.    */
  33.                   long (*xpr_options)();    /* Multiple XPR options.    */
  34.                   long (*xpr_unlink)();     /* Delete a file.           */
  35.                   long (*xpr_squery)();     /* Query serial device      */
  36.                   long (*xpr_getptr)();     /* Get various host ptrs    */
  37.               };
  38. /*
  39. *   Number of defined extensions
  40. */
  41. #define XPR_EXTENSION 4L
  42.  
  43. /*
  44. *   The functions
  45. */
  46. extern long XProtocolSend(),  XProtocolReceive(),
  47.             XProtocolSetup(), XProtocolCleanup();
  48. /*
  49. *   Flags returned by XProtocolSetup()
  50. */
  51. #define XPRS_FAILURE    0x00000000L
  52. #define XPRS_SUCCESS    0x00000001L
  53. #define XPRS_NORECREQ   0x00000002L
  54. #define XPRS_NOSNDREQ   0x00000004L
  55. #define XPRS_HOSTMON    0x00000008L
  56. #define XPRS_USERMON    0x00000010L
  57. #define XPRS_HOSTNOWAIT 0x00000020L
  58. /*
  59. *   The update structure
  60. */
  61. struct XPR_UPDATE {     long  xpru_updatemask;
  62.                         char *xpru_protocol;
  63.                         char *xpru_filename;
  64.                         long  xpru_filesize;
  65.                         char *xpru_msg;
  66.                         char *xpru_errormsg;
  67.                         long  xpru_blocks;
  68.                         long  xpru_blocksize;
  69.                         long  xpru_bytes;
  70.                         long  xpru_errors;
  71.                         long  xpru_timeouts;
  72.                         long  xpru_packettype;
  73.                         long  xpru_packetdelay;
  74.                         long  xpru_chardelay;
  75.                         char *xpru_blockcheck;
  76.                         char *xpru_expecttime;
  77.                         char *xpru_elapsedtime;
  78.                         long  xpru_datarate;
  79.                         long  xpru_reserved1;
  80.                         long  xpru_reserved2;
  81.                         long  xpru_reserved3;
  82.                         long  xpru_reserved4;
  83.                         long  xpru_reserved5;
  84.                    };
  85. /*
  86. *   The possible bit values for the xpru_updatemask are:
  87. */
  88. #define XPRU_PROTOCOL           0x00000001L
  89. #define XPRU_FILENAME           0x00000002L
  90. #define XPRU_FILESIZE           0x00000004L
  91. #define XPRU_MSG                0x00000008L
  92. #define XPRU_ERRORMSG           0x00000010L
  93. #define XPRU_BLOCKS             0x00000020L
  94. #define XPRU_BLOCKSIZE          0x00000040L
  95. #define XPRU_BYTES              0x00000080L
  96. #define XPRU_ERRORS             0x00000100L
  97. #define XPRU_TIMEOUTS           0x00000200L
  98. #define XPRU_PACKETTYPE         0x00000400L
  99. #define XPRU_PACKETDELAY        0x00000800L
  100. #define XPRU_CHARDELAY          0x00001000L
  101. #define XPRU_BLOCKCHECK         0x00002000L
  102. #define XPRU_EXPECTTIME         0x00004000L
  103. #define XPRU_ELAPSEDTIME        0x00008000L
  104. #define XPRU_DATARATE           0x00010000L
  105. /*
  106. *   The xpro_option structure
  107. */
  108. struct xpr_option {
  109.    char *xpro_description;      /* description of the option                  */
  110.    long  xpro_type;             /* type of option                             */
  111.    char *xpro_value;            /* pointer to a buffer with the current value */
  112.    long  xpro_length;           /* buffer size                                */
  113. };
  114. /*
  115. *   Valid values for xpro_type are:
  116. */
  117. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  118. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  119. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  120. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  121. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  122. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  123.  
  124. #endif
  125.